// https://developer.mozilla.org/zh-CN/docs/Web/API/PerformanceTiming
import * as events from '../../utils/events';
import { getPerformanceTime } from '../../utils/time';

export default {
    init: (cb) => {
        events.domReady(() => {
            let perfData = getPerformanceTime();
            perfData.type = 'domReady';
            cb(perfData);
        });

        events.onload(() => {
            let perfData = getPerformanceTime();
            perfData.type = 'onload';
            cb(perfData);
        });
    }
};
